package com.shensi.api.admin.client.integral;

import com.shensi.api.admin.client.fallback.integral.IntegralOrderClientFallBack;
import com.shensi.api.admin.domian.integral.dto.IntegralOrderDto;
import com.shensi.common.core.constant.CloudConstant;
import com.shensi.common.core.domain.AjaxResult;
import com.shensi.common.core.page.TableDataInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;


/**
 * @author mao
 */
@FeignClient(
        value = CloudConstant.ADMIN_SERVER,
        fallbackFactory = IntegralOrderClientFallBack.class)
@Component
public interface IntegralOrderClient {


    /**
     * 查询积分消费订单列表
     */
    @GetMapping("/integral/order/list")
    public TableDataInfo list(@SpringQueryMap IntegralOrderDto integralOrder);

    /**
     * 导出积分消费订单列表
     */
    @GetMapping("/integral/order/export")
    public AjaxResult export(IntegralOrderDto integralOrder);

    /**
     * 获取积分消费订单详细信息
     */
    @GetMapping(value = "/integral/order/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id);

    /**
     * 新增积分消费订单
     */
    @PostMapping("/integral/order")
    public AjaxResult add(@RequestBody IntegralOrderDto integralOrder);

    /**
     * 修改积分消费订单
     */
    @PutMapping("/integral/order")
    public AjaxResult edit(@RequestBody IntegralOrderDto integralOrder);
    /**
     * 删除积分消费订单
     */
    @DeleteMapping("/integral/order/{ids}")
    public AjaxResult remove(@PathVariable("ids") Long[] ids);
}
